#coding:utf-8
import os
import wsgiref.handlers
from google.appengine.ext import webapp
from google.appengine.ext import db
from google.appengine.ext.webapp import template


class Grade(db.Model):
    course_name = db.StringProperty()
    cid = db.StringProperty()
    grade = db.StringProperty()
    sid = db.StringProperty()
    added_results_on = db.DateTimeProperty(auto_now=True)
    period = db.StringProperty()
    def has_sept(self):
        return self.period == u"ΣΕΠΤ"
    def has_june(self):
        return self.period == u"ΙΟΥΝ"
        pass
    def has_febr(self):
        return self.period == u"ΦΕΒΡ"
    
    

class Course(db.Model):
    cid = db.StringProperty()
    name = db.StringProperty()
    has_results = db.BooleanProperty(default=False)
    updated = db.IntegerProperty()
    added_results_on = db.DateTimeProperty(auto_now=True)
    has_sept = db.BooleanProperty(default=False)
    has_febr = db.BooleanProperty(default=False)
    has_june = db.BooleanProperty(default=False)
    

class Settings(db.Model):
    period = db.StringProperty()
    default_num_of_updates = db.IntegerProperty(default=2)
    forced_updates = db.BooleanProperty(default=False)





